package xjtu.sad.zbsj.util;

import java.util.ArrayList;
import java.util.List;

public class MenuItem {
    private String name;
    private Integer id;
    private Boolean disable;
    private String icon;
    private String path;
    private Boolean hasChildren;
    private Integer parentMenuId;
    private List<MenuItem> children;

    public MenuItem() {
        disable = false;
        children = new ArrayList<>();
    }

    public void appendChildren(MenuItem menuItem) {
        children.add(menuItem);
    }


    public List<MenuItem> getChildren() {
        return children;
    }

    public void setChildren(List<MenuItem> children) {
        this.children = children;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public Integer getParentMenuId() {
        return parentMenuId;
    }

    public void setParentMenuId(Integer parentMenuId) {
        this.parentMenuId = parentMenuId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Boolean getDisable() {
        return disable;
    }

    public void setDisable(Boolean disable) {
        this.disable = disable;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public Boolean getHasChildren() {
        return hasChildren;
    }

    public void setHasChildren(Boolean hasChildren) {
        this.hasChildren = hasChildren;
    }


    @Override
    public String toString() {
        return "MenuItem{" +
                "name='" + name + '\'' +
                ", id=" + id +
                ", disable=" + disable +
                ", icon='" + icon + '\'' +
                ", path='" + path + '\'' +
                ", hasChildren=" + hasChildren +
                ", children=" + children +
                '}';
    }
}
